package com.lenovo.rc.sil.wangdwa.learning;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

public class LocalThread extends Thread {
	
	private Handler mHandler = null;
	private HandlerDemoActivity mContext = null;
	
	public LocalThread(HandlerDemoActivity context) {
		this.mContext = context;
	}
	
	public LocalThread(HandlerDemoActivity context, Handler handler) {
		this.mContext = context;
		this.mHandler = handler;
	}

	@Override
	public void run() {
		// TODO Auto-generated method stub
		super.run();
		
		Bundle bundle = new Bundle();
		bundle.putCharSequence("sender", mContext.getTitle());
		bundle.putString("msg", "Hi, Paul.");
		
		Message msg = new Message();
		msg.setData(bundle);
		mHandler.sendMessage(msg);
	}
	
	

}
